package com.wj.console.constant;




/**
 * 通用枚举类
 */
public class Enums {

	// 结果码
	public static enum RESULT_CODE {
		SUCCESS("1", "操作成功！"),
		FAILURE("0", "操作失败！"),
		
		PARAM_LACK("102", "请求缺少必要参数！"), 
		AUTH_LIMIT("106", "接口访问权限受限！"), 
		OP_FREQUENTLY("107", "操作频繁！"), 
		SYS_BUSY("108", "系统繁忙！"), 
		USER_NOT_EXIST("203", "用户不存在！"), 
		PASSWORD_ERROR("204", "用户密码错误！"), 
		VERIFICATION_CODE_ERROR("205", "验证码错误！"), 
		OBJECT_NOT_EXIST("206", "查询对象不存在！"), 
		BUSINESSFAILED("212","业务异常"),
		SOCIAL_LOCK("310","本账号因为错误密码输入次数过多，已经被锁定，请次日再试"),
		
		SYSTERM_MAINTAIN("311","系统维护");
		public String key;
		public String value;

		private RESULT_CODE(String key, String value) {
			this.key = key;
			this.value = value;
		}
		public static RESULT_CODE get(String key) {
			RESULT_CODE[] values = RESULT_CODE.values();
			for (RESULT_CODE object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		public String toString() {
			return key;
		}
	}
	
	
	//Cache key
	public static enum CACHE_KEY {
		WS_ADDRESS("welfareShop:address"), //地址
		WS_ADDRESS_MAP_TREE("tree"), //树状结构地址
		WS_ADDRESS_MAP_TILE("tile"), //平铺结构地址
		WS_CATE("welfareShop:cate"), //商品分类
		WS_CATE_MAP_TREE("tree"), //树状结构商品分类
		WS_CATE_MAP_TILE("tile"), //平铺结构商品分类
		WS_PRODUCT("welfareShop:product"), //商品
		WS_PRODUCT_MAP("products"), //商品信息
		
		WS_BATCH_LOCK_ADDRESS("welfareshop-batch-lock:address"),//福利商城地址跑批锁
		WS_BATCH_LOCK_PRODUCT("welfareshop-batch-lock:product"),//福利商城商品跑批锁
		WS_BATCH_LOCK_PRODUCTCATE("welfareshop-batch-lock:productCate"),//福利商城商品分类跑批锁
		WS_BATCH_LOCK_ORDERSTATUS("welfareshop-batch-lock:orderStatus");//福利商城订单/售后单状态跑批锁
		
		public String keyName;

		private CACHE_KEY(String keyName) {
			this.keyName = keyName;
		}
		public String toString() {
			return keyName;
		}
	}
	
	// 福利商城 系统订单状态
	public static enum SYS_ORDER_STATUS {
		WAIT_PAY("0", "待支付"),
		ALREADY_CANCEL("1", "已取消"),
		ALREADY_PAY("2", "已支付"),
		
		WAIT_SEND("3", "待发货"),
		WAIT_RECEIVE("4", "待收货"),
		ALREADY_COMPLETE("5", "已完成"),
		AFTER_SALEING("6", "售后中"),
		ALREADY_REFUND("7", "已退款"),
		PART_REFUND("8", "部分退款");
		
		public String key;
		public String value;

		private SYS_ORDER_STATUS(String key, String value) {
			this.key = key;
			this.value = value;
		}
		public static SYS_ORDER_STATUS get(String key) {
			SYS_ORDER_STATUS[] values = SYS_ORDER_STATUS.values();
			for (SYS_ORDER_STATUS object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		
		public boolean eq(String str){
			if(str != null && !"".equals(str)){
				return this.toString().equals(str);
			}
			return false;
		}
		public String getValue() {
			return this.value;
		}
		
		public String toString() {
			return key;
		}
	}
	
	// 福利商城 云中鹤订单状态
	public static enum YZH_ORDER_STATUS {
		WAITING_PAY("waiting_pay", "等待付款"),
		WAITING_SHIPMENT("waiting_shipment", "等待发货"),
		WAITING_CONFIRMED("waiting_confirmed", "等待确认收货"),
		COMPLETED("completed", "订单已完成"),
		CANCELD("canceld", "订单作废"),
		CANCLED_BEFORE_PAY("cancled_before_pay", "订单关闭"),
		AFTER_SALE_SERVICE("after_sale_service", "售后服务中");
		
		public String key;
		public String value;

		private YZH_ORDER_STATUS(String key, String value) {
			this.key = key;
			this.value = value;
		}
		public static YZH_ORDER_STATUS get(String key) {
			YZH_ORDER_STATUS[] values = YZH_ORDER_STATUS.values();
			for (YZH_ORDER_STATUS object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		public boolean eq(String str){
			if(str != null && !"".equals(str)){
				return this.toString().equals(str);
			}
			return false;
		}
		public String getValue() {
			return this.value;
		}
		public String toString() {
			return key;
		}
	}
	
	// 福利商城 系统售后状态
	public static enum SYS_AFTER_SALE_STATUS {
		WAIT_SURE("0", "待确认"),
		AFTER_SALEING("1", "售后中"),
		ALREADY_COMPLETE("2", "已完成"),
		ALREADY_REFUSE("3", "已驳回");
		
		public String key;
		public String value;

		private SYS_AFTER_SALE_STATUS(String key, String value) {
			this.key = key;
			this.value = value;
		}
		public static SYS_AFTER_SALE_STATUS get(String key) {
			SYS_AFTER_SALE_STATUS[] values = SYS_AFTER_SALE_STATUS.values();
			for (SYS_AFTER_SALE_STATUS object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		public boolean eq(String str){
			if(str != null && !"".equals(str)){
				return this.toString().equals(str);
			}
			return false;
		}
		public String getValue() {
			return this.value;
		}
		public String toString() {
			return key;
		}
	}
	
	// 福利商城 云中鹤售后状态
	public static enum YZH_AFTER_SALE_STATUS {
		WAIT_SURE("waiting_audit", "等待客服确认"),
		WAIT_RECEIVE("waiting_confirmed", "等待仓库收货"),
		REFUND_PROCESSING("waiting_finance", "退款处理中"),
		ALREADY_COMPLETE("completed", "已完成"),
		ALREADY_REFUSE("declined", "已拒绝");
		
		public String key;
		public String value;

		private YZH_AFTER_SALE_STATUS(String key, String value) {
			this.key = key;
			this.value = value;
		}
		public static YZH_AFTER_SALE_STATUS get(String key) {
			YZH_AFTER_SALE_STATUS[] values = YZH_AFTER_SALE_STATUS.values();
			for (YZH_AFTER_SALE_STATUS object : values) {
				if (object.key.equals(key)) {
					return object;
				}
			}
			return null;
		}
		public boolean eq(String str){
			if(str != null && !"".equals(str)){
				return this.toString().equals(str);
			}
			return false;
		}
		public String getValue() {
			return this.value;
		}
		public String toString() {
			return key;
		}
	}
	
}
